package es.cazadoresmadridejos.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;

@Entity(name="Group")
@Table(name="grupo")
public class Group extends BaseEntity {

	private Integer number;
	private Partner bossGroup;
	
	public Group(long longValue) {
		super.setId(longValue);
	}
	public Group() {
	}
	@Column(name="numero")
	public Integer getNumber() {
		return number;
	}
	public void setNumber(Integer number) {
		this.number = number;
	}
	@OneToOne(optional=true,fetch=FetchType.EAGER)
	@Cascade(value=org.hibernate.annotations.CascadeType.DELETE_ORPHAN)
	@JoinColumn(name="usuario")
	public Partner getBossGroup() {
		return bossGroup;
	}
	public void setBossGroup(Partner bossGroup) {
		this.bossGroup = bossGroup;
	}
	
	
}
